#include "kf_random.h"

MTRand g_twister;

namespace kf
{

    MTRand &getGlobalTwister()
    {
        return g_twister;
    }

    float randomF()
    {
        return float(g_twister.rand());
    }

    unsigned int random()
    {
        return g_twister.randInt();
    }

    float randomF(float start, float end)
    {
        return float(g_twister.rand()*(end-start)+start);
    }

    int random(int start, int end)
    {
        if(start<end)
            return g_twister.randInt()%(end-start+1)+start;
        else
            return g_twister.randInt()%(start-end+1)+end;
    }


}
